<?

if ($EXCMS != "work") {
	header ("Location: ../../index.php");
	exit;
}

define ("_DARK_TR_", "ffe7da");

function site_message ($mess)
{
	echo "\n\n<br /><p /><div align=\"center\"><table class=\"message\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"right\" valign=\"top\" width=\"30%\"><img align=\"absmiddle\" src=\"themes/admin/images/ok.gif\"></td><td align=\"left\" style=\"padding-left:10px\"> $mess!</td></tr></table></div>\n";
}
function site_error ($warn)
{
	echo "\n\n<br /><p /><div align=\"center\"><table class=\"error\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"right\" valign=\"top\" width=\"30%\"><img align=\"absmiddle\" src=\"themes/admin/images/warn.gif\"></td><td align=\"left\" style=\"padding-left:10px\"> $warn!</td></tr></table></div>\n";
}
function print_header ($title, $site_name)
{
	print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
print "<html>
<head>
<title>$title - Administrator control panel</title>

<meta name=\"generator\" content=\"Excalibur CMS Engine 2.3\">
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">

<script language='JavaScript' type='text/javascript' src='include/editor/wysiwyg.js'></script>
<script  type=\"text/javascript\" src=\"include/overlib_mini.js\"></script>\n\n";
}

function past_table ($header, $body)
{
	print "\n<p><div align=\"center\"><table class=\"main_table\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
	<tr>
		<td class=\"main_table_header\" align=\"left\">$header</td>
	</tr>
	<tr>
		<td class=\"main_table_body\" align=\"left\">
 			$body
		</td>
	</tr>
</table></div>\n\n";
}
function past_big_table ($header, $body, $bottom)
{
	print "\n<p><div align=\"center\"><table class=\"main_table\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
	<tr>
		<td class=\"main_table_header\" align=\"left\">$header</td>
	</tr>
	<tr>
		<td class=\"main_table_body\" align=\"left\">
 			$body
		</td>
	</tr>
	<tr>
		<td class=\"main_table_body\" align=\"left\">
 			$bottom
		</td>
	</tr>
</table></div>\n\n";
}

function left_r () { print "\n\n<td width=\"220\" valign=\"top\">\n<!-- START NAVIGATION -->\n\n"; }
function left_r1 () { print "\n\n<!-- END NAVIGATION -->\n\n</td><td valign=\"top\" class=\"center_td\">\n\n<!-- START BODY -->\n\n"; }
function right_r1 () { print "\n\n<!-- END NAVIGATION -->\n\n</td>\n"; }
function right_r () { print "\n\n<!-- END BODY -->\n\n</td>\n\n<td width=\"200\" valign=\"top\">\n<!-- START NAVIGATION 2 -->\n\n"; }
function center_s () { print "\n\n<td valign=\"top\" style=\"padding-left:10px\">\n\n<!-- START BODY -->\n\n"; }
function center_e () { print "\n\n\n<!-- END BODY -->\n\n</td>\n\n"; }

function print_big_authorization ($message, $url) {
	global $SITE;
	print_header ("Авторизация", "");
	include "themes/admin/style.css";
	
	print "\n\n</head>
<body topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" onsave=\"return false;\">
<img src=\"images/spacer.gif\" width=\"1\" height=\"100\">
<center><div style=\"width:500px\">";

	$form = "\n\n<form name=\"auth\" action='admin.php?admin_mod=enter' method=POST>
<input type=\"hidden\" name=\"url\" value=\"$url\">
<table align=\"right\" width=\"70%\" cellspacing=\"0\" cellpadding=\"2\">
 	<tr>
		<td class=\"main_table_header\" align=\"left\">Авторизация</td>
	</tr>
	<tr>
		<td align=\"center\" colspan=\"2\" style=\"padding-bottom:10px\"><font color=\"red\">$message</font></td>
	</tr>
	<tr>
		<td align=\"right\" width=\"40%\">Ваш логин:</td>
		<td style=\"padding-left:20px\"><input style=\"width:160px\" type=\"text\" name=\"login\" value=\"\" maxleight=\"10\" class=\"form\"></td>
	</tr>
	<tr>
		<td align=\"right\">Ваш пароль:</td>
		<td style=\"padding-left:20px\"><input style=\"width:160px\" type=\"password\" name=\"pass\" value=\"\" maxleight=\"10\" class=\"form\"></td>
	</tr>
	<tr>
		<td align=\"right\"><label for=\"remember\">Запомнить</label> <input type=\"checkbox\" name=\"remember\" title=\"Запомниить\" id=\"remember\"></td>
		<td style=\"padding-left:20px\"><input style=\"width:160px\" type=\"submit\" name=\"ok\" class=\"button\" value=\"Вход\"></td>
	</tr>
 	<tr>
		<td align=\"center\" colspan=\"2\" style=\"padding-top:10px\">[ <a href=\"index.php\">Назад</a> ]</td>
	</tr>
</table>
</form>";
	simple_table ($form);
print "\n</div>
</body>
</html>";
}

function big_message ($mess, $url) {
	global $SITE;
	print_header ("Авторизация", "");
	include "themes/admin/style.css";
	
	print "\n\n</head>
<body topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" onsave=\"return false;\">
<img src=\"images/spacer.gif\" width=\"1\" height=\"100\">
<center><div style=\"width:650px\">";
	simple_table ("<center>$mess<hr class=\"hr\" width=\"90%\" /><small>Если ваш браузер не поддерживает автоматической переадресации нажмите здесь</small><br><input class=\"button\" type=\"button\" value=\"Перейти\" onclick=\"document.location.href='$url';\" style=\"width:160px\">");
print "\n</div>
</body>
</html>";
}
function come_back ($name, $url) {
	print "\n\n<br /><p /><div class=\"simple_table_div\"><table class=\"simple_table\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
		<tr>
			<td align=\"right\" width=\"50%\"><img src=\"themes/admin/images/simple_top_r.gif\" /></td>
		</tr>
		<tr><td class=\"simple_table_body\" align=\"center\"><a href='$url'>Вернуться к $name</a></td></tr>
		<tr>
			<td align=\"right\" width=\"50%\"><img src=\"themes/admin/images/simple_bot_r.gif\" /></td>
		</tr>
	</table></div><img src=\"themes/admin/images/spacer.gif\" width=\"1\" height=\"30\" />";
}

function simple_table ($text) {
	print "\n\n<br /><p /><div class=\"simple_table_div\"><table class=\"simple_table\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
		<tr>
			<td align=\"right\" width=\"50%\"><img src=\"themes/admin/images/simple_top_r.gif\" /></td>
		</tr>
		<tr><td class=\"simple_table_body\" align=\"left\">$text</td></tr>
		<tr>
			<td align=\"right\" width=\"50%\"><img src=\"themes/admin/images/simple_bot_r.gif\" /></td>
		</tr>
	</table></div><img src=\"themes/admin/images/spacer.gif\" width=\"1\" height=\"30\" />";
}
?>
